<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:aui="http://liferay.com/faces/aui"
	xmlns:c="http://java.sun.com/jsp/jstl/core" 
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" 
	xmlns:bridge="http://liferay.com/faces/bridge"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:example-cc="http://java.sun.com/jsf/composite/example-cc"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	
	<h:head />
	
	<f:event listener="#{invoiceConfigurationController.init}" type="preRenderView" />
	
	<h:body>
		<h:form>
			<h:outputLabel value="Eintstellungen für die Seite 'Rechnungen'" styleClass="configurationTitle" />
			<h:outputText value="Berechtigungen Navigation:" styleClass="configurationSubtitle" />
			<table class="roleSubfunctionTable" >
			    <thead>
			        <tr>
			            <th>Rolle</th>
			            <ui:repeat value="#{invoiceConfigurationController.subfunctions.values().toArray()}" var="subfunction">
			                <th>#{subfunction}</th>
			            </ui:repeat>
			        </tr>
			    </thead>
			    <tbody>
			        <ui:repeat value="#{invoiceConfigurationController.roles.entrySet().toArray()}" var="role">
			            <tr>
			                <td>#{role.value}</td>
			                <ui:repeat value="#{invoiceConfigurationController.subfunctions.keySet().toArray()}" var="subfunction">
			                    <td><p:selectBooleanCheckbox value="#{invoiceConfigurationController.roleSubfunctions[role.key][subfunction]}" styleClass="electroOffice-checkbox" /></td>
			                </ui:repeat>
			            </tr>
			        </ui:repeat>
			    </tbody>
			</table>
			<p:commandButton value="Speichern" actionListener="#{invoiceConfigurationController.submit}" styleClass="electroOffice-button" />
		</h:form>
	</h:body>
</f:view>